<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<script type="text/javascript" src="js/lib/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="js/lib/jquery.json-2.3.min.js"></script>
	<script type="text/javascript" src="js/lib/jquery.websocket-0.0.1.js"></script>
	<title>WebSocket Sample</title>
</head>
<script type="text/javascript">
$(document).ready(function(){
	var ws = $.websocket("ws://localhost:8080/sample_websocket/chat/", {
		events: {
			message: function(e) {$("#content").append(e.data + "<br>")}
		}
	});
	$("#message").change(function(){
		alert(this.value);
		ws.send("message", this.value);
		this.value = "";
	});	
});

</script>
<body>
  <section id="content">
  </section>
  <input type="text" value="" id="message">
</body>
</html>